package com.weijian.common.exception;

/**
 * 认证异常
 *
 * @author miaoma
 */
public class AuthenticationException extends RuntimeException {

    /**
     * 错误码
     */
    private final Integer code;

    public AuthenticationException(String message) {
        super(message);
        this.code = 401;
    }

    public AuthenticationException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public AuthenticationException(String message, Throwable cause) {
        super(message, cause);
        this.code = 401;
    }

    public AuthenticationException(String message, Integer code, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }
}
